/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.querie.util;

import com.querie.collab.ItemSimilarity;
import com.querie.collab.JacItemSimilarity;
import com.querie.collab.CosineItemSimilarity;

/**
 *
 * @author a-skoshy
 */
public class QueryThread extends Thread {

    public void run() {
      try{
        ItemSimilarity sim = null;
        QryParameters qParam = QryParameters.getInstance();
        String algoType = qParam.getValue("ALGO");
        if (algoType.equals("jac")) {
            sim = new JacItemSimilarity();
        } else if (algoType.equals("cos")) {
            sim = new CosineItemSimilarity();
        } else {
            throw new Exception("Unknown Algorithm");
        }
        sim.selectKSimItem();
        sim.close();
      }catch(Exception ex){
          ex.printStackTrace();
      }
    }
}
